<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <![endif]-->
    <title>用户基本信息修改</title>
</head>
<body>
<div class="contant">
<div class="row">
        <!--<div class="top">首页>用户基本信息修改</div>-->
        <div class="content addapply">
            <div class="fl">
                <div class="box all-box">
            <form id="applyForm" method="post" action="{:U('Apply/editBase')}">
                    <h1>客户信息<span>(标*为必填项)</span></h1>
                    <div class="list-block">
                        <div class="sr-only">
                            <input id="user-id" type="hidden" name="userid" value={$info.id}>
                            <input id="apply-id" type="hidden" name="applyId" value={$info.entry_no}>
                            <input id="mate-name" type="hidden" name="" value={$info.spouse_name}>
                            <input id="mate-idty" type="hidden" name="" value={$info.spouse_identity_no}>
                            <input id="mate-mobile" type="hidden" name="" >
                            <input id="company" type="hidden" name="" >
                            <input id="address" type="hidden" name="" >
                            <input id="first-commit-time" type="hidden" name="" value={$info.create_time}>
                            <!-- <input id="contact1-name" type="hidden" >
                            <input id="contact1-mobile" type="hidden" >
                            <input id="contact1-relationship" type="hidden" >
                            <input id="contact2-name" type="hidden" >
                            <input id="contact2-mobile" type="hidden" >
                            <input id="contact2-relationship" type="hidden" > -->
                            <foreach name="contactors" item="contactor" >
                                <input type="hidden" id=contactor{$key+1}name value={$contactor.user_name}>
                                <input type="hidden" id=contactor{$key+1}mobile value={$contactor.telephone}>
                                <input type="hidden" id=contactor{$key+1}relationship value={$contactor.relationship}>
                            </foreach>
                        </div>
                        <div class="row">
                            <input id="telephone" type="hidden" value={$info.telephone}>
                            <label>姓名: <i class="required">*</i></label>
                            <input id="user-name" type="text" name="" value={$info.user_name}>
                            <label>身份证号: <i class="required">*</i></label>
                            <input id="identy-no" style="width: 160px;" type="text" name="" value={$info.identity_no}>
                            <label>贷款银行: <i class="required">*</i></label>
                            <input type="text" name="" value={$info.bank_name}>
                        </div>
                        <div class="row">
                            <label>上传照片: <i class="required">*</i></label>
                            <label class="inputfile" for=""><a class="preview" rel="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.identity_photo_pros}"><img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.identity_photo_pros}" ><i>身份证正面</i></a></label>
                            <label class="inputfile" for=""><a class="preview" rel="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.identity_photo_cons}"><img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.identity_photo_cons}" ><i>身份证反面</i></a></label>
                            <label class="inputfile" for=""><a class="preview" rel="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.credit_authorize_photo}"><img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.credit_authorize_photo}" ><i>提交征信授权书</i></a></label>
                        </div>
                        <div class="row">
                            <label>配偶姓名: <i class="required">*</i></label>
                            <input type="text" name="spouse_name" value={$info.spouse_name}>
                            <label>身份证号: <i class="required">*</i></label>
                            <input style="width: 160px;" type="text" name="spouse_identity_no" value={$info.spouse_identity_no}>
                        </div>
                        <div class="row">
                            <label>上传照片: <i class="required">*</i></label>
                            <label class="inputfile" for="">
                                <a class="preview" rel="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.spouse_id_photo_pros}">
                                <img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.spouse_id_photo_pros}" ><i>身份证正面</i>
                                </a>
                            </label>
                            <label class="inputfile" for="">
                                <a class="preview" rel="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.spouse_id_photo_cons}">
                                <img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.spouse_id_photo_cons}" ><i>身份证反面</i>
                                </a>
                            </label>
                            <label class="inputfile" for="">
                                <a class="preview" rel="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.spouse_credit_authorize_photo}">
                                <img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.spouse_credit_authorize_photo}" ><i>提交征信授权书</i>
                                </a>
                            </label>
                        </div>
                        <div class="row">
                            <label>担保人姓名: <i class="required">*</i></label>
                            <input type="text" name="assure_name" value={$info.assure_name}>
                            <label>身份证号: <i class="required">*</i></label>
                            <input style="width: 160px;" name="assure_identity_no" value={$info.assure_identity_no}>
                            <button class="addmore">添加</button>
                        </div>
                        <div class="row">
                            <label>上传照片: <i class="required">*</i></label>
                            <label class="inputfile" for="">
                                <a class="preview" rel="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.assure_id_photo_pros}"><img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.assure_id_photo_pros}" ><i>身份证正面</i></a>
                            </label>
                            <label class="inputfile" for="">
                                <a class="preview" rel="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.assure_id_photo_cons}"><img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.assure_id_photo_cons}" ><i>身份证反面</i></a>
                            </label>
                            <label class="inputfile" for="">
                                <a class="preview" rel="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.assure_credit_authorize_photo}"><img class="pic" src="http://{$_SERVER['HTTP_HOST']}/Uploads/{$info.assure_credit_authorize_photo}" ><i>提交征信授权书</i></a>
                            </label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="fr">
                <div class="box all-box">
                    <h1>信用记录</h1>
                    <div class="list-block">
                        <div class="row">
                            <label>借款人信息:<i class="required">*</i></label>
                            <input id="apply-status" type="hidden" name="status" value={$info.status}>
                            <input type="hidden" name="user_id" value={$info.id}>
                            <textarea name="master_info" id="" cols="38" rows="5">{$info.master_info}</textarea>
                        </div>
                        <div class="row {$info['spouse_name']?'':'sr-only'}">
                            <label>配偶人信息:<i class="required">*</i></label>
                            <textarea name="spouse_info" id="" cols="38" rows="5">{$info.spouse_info}</textarea>
                        </div>
                        <div class="row {$info['assure_name']?'':'sr-only'}">
                            <label>担保人信息:<i class="required">*</i></label>
                            <textarea name="assure_info" id="" cols="38" rows="5">{$info.assure_info}</textarea>
                        </div>
                    </div>
                </div>
                <div class="box all-box" id="extra-info">
                    <h1>操作</h1>
                    <div class="list-block">
                        <input id="apply-adopt" type="button" class="btn btn-success" value="通过" name="">
                        <input id="apply-reject" type="button" class="btn btn-danger" value="驳回" name="">
                    </div>
                </div>
                </form>
            </div>
        </div>
    </div>
</div>
<style type="text/css">
    i{cursor: pointer;}
    .pic{
        width:142px;
        height:120px;
        border-radius:0% ;
        cursor: pointer;
        background: #fff;
        /*position: absolute;
        */z-index: 1;
    }

    #preview{
        position:absolute;border:1px solid #ccc;
        background:#333;padding:3px;display:none;color:#fff;
        opacity: .9;
    }
</style>
<script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
<script type="text/javascript">

    this.imagePreview = function(){
            xOffset = 10;
            yOffset = 30;

        $("a.preview").hover(function(e){
            this.t = this.title;
            this.title = "";
            var c = (this.t != "") ? "<br/>" + this.t : "";
            $("body").append("<div id='preview'><img width=600 src='"+ this.rel +"' alt='Image preview' />"+ c +"</div>");
            $("#preview")
                .css("top",(e.pageY - xOffset) + "px")
                .css("left",(e.pageX + yOffset) + "px")
                .fadeIn("fast");
        },
        function(){
            this.title = this.t;
            $("#preview").remove();
        });
        $("a.preview").mousemove(function(e){
            $("#preview")
                .css("top",(e.pageY - xOffset) + "px")
                .css("left",(e.pageX + yOffset) + "px");
        });
    };


    // starting the script on page load
    $(document).ready(function(){
        imagePreview();
    });

    // 审核通过
    $('#apply-adopt').click(function(){
        $('#apply-status').val(4);
        if (confirm('确认通过吗？')==true){
            $('#applyForm').submit();
        }else{
          return false;
        }
    });

    // 驳回
    $('#apply-reject').click(function(){
        $('#apply-status').val(901);
        if (confirm('确认驳回吗？')==true){
            $('#applyForm').submit();
        }else{
          return false;
        }
    });
</script>
